package router

import (
	"github.com/gin-gonic/gin"
	"onerk4/zg5yk/ordering/api/handler"
	"onerk4/zg5yk/ordering/api/middleware"
	"onerk4/zg5yk/ordering/common/pkg"
)

func LoadRouter(r *gin.Engine) {
	r.POST("/callback", handler.Callback)
	r.POST("/login", handler.Login)
	r.GET("/showTakeoutList", handler.ShowTakeoutList)
	r.POST("/upload", handler.Upload)
	r.Use(middleware.Middleware())
	r.Use(pkg.JWTAuth("2209a"))
	r.POST("/receiveCoupon", handler.ReceiveCoupon)
	r.GET("/showCoupon", handler.ShowCoupon)
	r.GET("/userRecommend", handler.UserRecommend)
	r.POST("/createOrder", handler.CreateOrder)
	r.GET("/showOrderList", handler.ShowOrderList)
}
